package com.woniu.service.command;

import com.woniu.inlet.fo.FundGraphVo;
import com.woniu.util.ApplicationContextHolder;
import com.woniu.util.po.NetWorth;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.net.URISyntaxException;
import java.util.List;

/**
 * @description:
 * @author: my
 * @time: 2021/4/25 20:08
 */
@Data
public class FundGraphCommand {
    private FundGraphCommandHandler handler;
    private FundGraphVo fundGraphVo;

    public FundGraphCommand(){
        this.handler =
                ApplicationContextHolder.getApplicationContext().getBean(FundGraphCommandHandler.class);
    }

    public FundGraphCommand(FundGraphVo fundGraphVo){
        this();
        this.fundGraphVo = fundGraphVo;
    }

    public List<NetWorth> execute() throws URISyntaxException {
        return this.handler.
                action(this);
    }
}
